#include "Shm.hpp"
#include "Fifo.hpp"

int main()
{
    Shm shm(pathname, projid, CREATER);
    // 创建管道文件
    NamedFifo fifo(PATH, FILENAME);

    // 文件操作
    FileOper readerfile(PATH, FILENAME);

    readerfile.OpenForRead();

    char *mem = (char *)shm.VirtualAddr();
    while (true)
    {
        if (readerfile.Wait())
        {
            printf("%s\n", mem);
        }
        else
            break;
    }

    readerfile.Close();

    //server的析构函数没被调用到
    //shm.~Shm();
    return 0;
}